home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / buttons / toolb160 / sample / document.frm < prev    next >
Text File  |  1994-09-05  |  3KB  |  109 lines

  1. VERSION 2.00
  2. Begin Form frmDocument 
  3.    Caption         =   "Untitled"
  4.    ClientHeight    =   4665
  5.    ClientLeft      =   1095
  6.    ClientTop       =   1485
  7.    ClientWidth     =   7860
  8.    Height          =   5070
  9.    Left            =   1035
  10.    LinkTopic       =   "Form1"
  11.    MDIChild        =   -1  'True
  12.    ScaleHeight     =   4665
  13.    ScaleWidth      =   7860
  14.    Top             =   1140
  15.    Width           =   7980
  16.    Begin TextBox txtDocument 
  17.       BorderStyle     =   0  'None
  18.       Height          =   1995
  19.       HideSelection   =   0   'False
  20.       Left            =   600
  21.       MultiLine       =   -1  'True
  22.       ScrollBars      =   3  'Both
  23.       TabIndex        =   0
  24.       Top             =   300
  25.       Width           =   2775
  26.    End
  27.    Begin Label lblAction 
  28.       AutoSize        =   -1  'True
  29.       Caption         =   "lblAction"
  30.       Height          =   195
  31.       Left            =   3660
  32.       TabIndex        =   1
  33.       Top             =   180
  34.       Visible         =   0   'False
  35.       Width           =   750
  36.    End
  37. End
  38. Option Explicit
  39. Dim mbChanged As Integer
  40.  
  41. Sub Form_Activate ()
  42. Dim I As Integer
  43.     CheckEditMenu
  44.     For I = 0 To frmMain!cboFontNames.ListCount - 1
  45.         If frmMain!cboFontNames.List(I) = Me.FontName Then
  46.             frmMain!cboFontNames.ListIndex = I
  47.             Exit For
  48.         End If
  49.     Next I
  50.     For I = 0 To frmMain!cboFontSizes.ListCount - 1
  51.         If CInt(Val(frmMain!cboFontSizes.List(I))) = Me.FontSize Then
  52.             frmMain!cboFontSizes.ListIndex = I
  53.             Exit For
  54.         End If
  55.     Next I
  56. End Sub
  57.  
  58. Sub Form_Resize ()
  59.     On Local Error Resume Next
  60.     txtDocument.Move 0, 0, Me.Width - 100, Me.Height - 390
  61. End Sub
  62.  
  63. Sub Form_Unload (Cancel As Integer)
  64.     CheckEditMenu
  65.     If mbChanged Then
  66.         If MsgBox(Me.Caption + Chr$(13) + Chr$(10) + "This file has changed. Save?", 36) = 6 Then
  67.             Set gcForm = Me
  68.             frmMain!lblAction.Caption = "save"
  69.             Set gcForm = Nothing
  70.             If mbChanged Then Cancel = True
  71.         End If
  72.     End If
  73. End Sub
  74.  
  75. Sub lblAction_Change ()
  76. Dim sTmp As String
  77.     If lblAction.Caption = "" Then Exit Sub
  78.     If InStr(lblAction.Caption, "set changed") = 1 Then
  79.         sTmp = Trim$(Mid$(lblAction.Caption, InStr(lblAction.Caption, "=") + 1))
  80.         If sTmp = "false" Then
  81.             mbChanged = False
  82.         Else
  83.             mbChanged = True
  84.         End If
  85.         lblAction.Caption = ""
  86.     End If
  87.     If InStr(lblAction.Caption, "get findposition") = 1 Then
  88.         lblAction.Caption = Format$(txtDocument.SelStart)
  89.     End If
  90. End Sub
  91.  
  92. Sub txtDocument_Change ()
  93.     mbChanged = True
  94.     CheckEditMenu
  95. End Sub
  96.  
  97. Sub txtDocument_Click ()
  98.     CheckEditMenu
  99. End Sub
  100.  
  101. Sub txtDocument_KeyUp (KeyCode As Integer, Shift As Integer)
  102.     CheckEditMenu
  103. End Sub
  104.  
  105. Sub txtDocument_MouseUp (Button As Integer, Shift As Integer, X As Single, Y As Single)
  106.     CheckEditMenu
  107. End Sub
  108.  
  109.